//
//  GengDuoVC.m
//  digitalCurrency
//
//  Created by 小震GG on 2019/11/5.
//  Copyright © 2019 XinHuoKeJi. All rights reserved.
//

#import "GengDuoVC.h"
#import "WMHTMLViewController.h"
#define Start_X 0.0f           // 第一个按钮的X坐标
#define Start_Y 30           // 第一个按钮的Y坐标
#define Width_Space 0.0f        // 2个按钮之间的横间距
#define Height_Space 0.0f      // 竖间距
#define Button_Height 70.0f    // 高
#define Button_Width (kWindowW/3.0)     // 宽

@interface GengDuoVC ()

@end

@implementation GengDuoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    self.viewTitle.text = LocalizationKey(@"更多");
    
    NSArray *headArr = @[LocalizationKey(@"ETH浏览器"), LocalizationKey(@"BTC浏览器"), LocalizationKey(@"EOS浏览器")];
    NSArray *headImageArr = @[@"app_icon2", @"app_icon3", @"app_icon4"];
    for (int i = 0; i < 3; i ++) {
        NSInteger index = i % 3;
        NSInteger page = i / 3;
        
        SYButton *headBtn = [[SYButton alloc]init];
        [self.view addSubview:headBtn];
        headBtn.frame = CGRectMake(index * (Button_Width + Width_Space) + Start_X, page  * (Button_Height + Height_Space)+Start_Y, Button_Width, Button_Height);
        [headBtn setTitle:headArr[i] forState:UIControlStateNormal];
        [headBtn setTitleColor:tThreeColor forState:UIControlStateNormal];
        [headBtn setImage:ImageName(headImageArr[i]) forState:UIControlStateNormal];
        headBtn.titleLabel.font = kFont(14);
        headBtn.btnType = TOP;
        headBtn.tag = 200 + i;
        [headBtn addTarget:self action:@selector(headBtnAct:) forControlEvents:UIControlEventTouchUpInside];
    }
}

- (void)headBtnAct:(UIButton *)sender{
    
    WMHTMLViewController *aboutC = [[WMHTMLViewController alloc] init];
       CGFloat bottomH     = kEasyShowSafeBottomMargin_S;
       aboutC.webViewRect  = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - kTopHeight - bottomH);
       aboutC.canScroll                = YES;
       aboutC.showProgressView         = YES;
       aboutC.hidesBottomBarWhenPushed = YES;
       
           
    if (sender.tag == 200) {
        aboutC.htmlUrl = @"https://etherscan.io/";

    }
    else if (sender.tag == 201) {
        aboutC.htmlUrl = @"https://m.btc.com/";
    }
    else if (sender.tag == 202) {
        aboutC.htmlUrl = @"https://eospark.com/";
    }
           
    [self.navigationController pushViewController:aboutC animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
